package windowBuilderExample;

import java.awt.*;
import java.awt.event.*;

public class MyFirstAwt {

	public static void main(String[] args) {
		Frame frame = new Frame();

		final Button button = new Button("Hello.");

		frame.add(button);
		ActionListener listener = new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				if (button.getLabel().equals("Hello.")) {
					button.setLabel("Good Morning.");
				} else {
					button.setLabel("Hello.");
				}
			}

		};

		button.addActionListener(listener);
		frame.setSize(300, 150);
		frame.show();
	}

}
